/*  This file is part of Phantom Power.
 *  Copyright (C) 2010 Jacob Dawid
 *
 *  Phantom Power is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Phantom Power is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Phantom Power. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MAIN_DIALOG_H
#define MAIN_DIALOG_H

#include <iostream>

#include <QMainWindow>
#include <QTextEdit>
#include <QList>
#include <QLabel>
#include <QTabWidget>
#include <QMenuBar>
#include <QAction>
#include <QMenu>
#include <QFileDialog>
#include <QDir>
#include <QUrl>
#include <QSettings>
#include <QCheckBox>
#include <QSlider>

#include "connection.h"
#include "device.h"
#include "usbDialog.h"
#include "wifiDialog.h"

class mainDialog : public QMainWindow
{
	// The main dialog is the central window. It is the first that pops up when the application
	// starts.

	Q_OBJECT
	public:
		mainDialog();
		~mainDialog();

	private:
		void setupUserInterface();
		QTextEdit* console;
		QTabWidget* connectionTypeSelect;
		QWidget* _wifiDialog, *_usbDialog;
		QSettings* settings;

		QTabWidget* deviceTypeSelect;
		QWidget* mouseSettings;
		QWidget* keyboardSettings;
		QWidget* sliderSettings;
		QWidget* gamepadSettings;

		connection* currentConnection;
		device* currentDevice;
	

	public slots:
		void handleReport(QString message);
		void establishWiFiConnection(int ip1, int ip2, int ip3, int ip4, int port);
		void cutWiFiConnection();
		void synchronize();

		void slotReverseX(int state);
		void slotReverseY(int state);
		void slotSpeedX(int state);
		void slotSpeedY(int state);
	signals:
		void synchronisation();
};
#endif
